<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Bannerapi extends Model
{
    protected $table ='banners';
    public $timestamps = false;
    protected $guarded = [
        'title', 'img', 'redirect_url', 'sort', 'on_line_time', 'off_line_time', 'created_at', 'updated_at'
    ];

    public function getData(){
        $bannerList = array();
        $sql = \DB::table($this->table)
            ->whereNull('deleted_at');

        $bannerList['list'] = $sql->select('img')->orderBy('created_at', 'desc')

            ->get();

        return $bannerList;
    }


}